<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>01</title>
    <style>
        .box1{
            width: 229px;
            height: 228px;
            border: 2px solid black;
            position: relative;
            /* 溢出隐藏 */
            overflow: hidden;
        }
        .img{
            width: 100%;
            height: 100%;
        }
        .mask-box{
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, .5);
            position: absolute;
            left: 0;
            top: 0;

            transform: translateY(-100%);
            /* 过渡 */
            transition: all 0.5s linear;
        }
        .box1:hover>.mask-box{
            transform:translateY(0);
        }
    </style>
</head>
<body>
    <div class="box1">
        <img src="./img/素材1.png" class="img1" alt="">
        <div class="mask-box">
        </div>
    </div>
</body>
<script>
    
</script>
</html>